﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfSnqkGasAnalysis.IData;
using WpfSnqkGasAnalysis.Model;

namespace WpfSnqkGasAnalysis.IData_impl
{
    /// <summary>
    /// 数据接口实现；
    /// </summary>
    /// 创建时间：2022-12-27 22:43:10。作者：王浩力
    public class Organic_sulfur_check_historyDAL_impl : BaseDAL,IOrganic_sulfur_check_historyDAL
    {
        public List<Organic_sulfur_check_history> GetList(long mainKey)
        {
            string sql = " select *  from Organic_sulfur_check_history where  Organic_sulfurtId_ID="+ mainKey;
          return  ExecSqlCmd(sql, null, c => { 
            var reader=c.ExecuteReader();
                if (!reader.HasRows)
                {
                    return null;
                }
                List<Organic_sulfur_check_history> list = new List<Organic_sulfur_check_history>();
                while (reader.Read())
                {
                  Organic_sulfur_check_history info = new Organic_sulfur_check_history();
                  info.Id = (long)reader["Id"].ToMyInt64();
                  info.Check_user_name = reader["Check_user_name"].ToString();
                  info.Check_user_id = (long)reader["Check_user_id"].ToMyInt64();
                  info.Check_time = reader["Check_time"].ToString();
                  info.Check_stat =(byte) reader["Check_stat"].ToMyInt64();
                  info.Reject_reason = reader["Reject_reason"].ToString();
                  info.Organic_sulfurtId_ID = (long)reader["Organic_sulfurtId_ID"].ToMyInt64();
                  list.Add(info);
              }
              return list;
            });

        }
    }
}
